package gui;

import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URI;
import java.util.Base64;
import java.util.Objects;

import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import app.helpers.Output;

public class JLabelLink extends JFrame {
  private static final String LOGO_DATA = "iVBORw0KGgoAAAANSUhEUgAAAd0AAACKCAYAAADvwZCVAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QQYDA4ppMr3sQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAgAElEQVR42u2deZRddZXvP/t37q2q1JCpEhLIUBkqlTAIiIwOD31ii4227cOgYEv60W1aW6ENEen13norL93vvT8YBKUdlwqI3SIRbRrbVlkOtAOKQRlDhgqZU5nnpKZ7zn5/nFMSioTce865t+45tT9r1R+QqnPP2fd3ft/f3r/92xsMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwxjNSAbvuTFn34EPlOrANgEwmFEbJnnu/lP8e0NG35NqU4rGbqZYe2Nn47xqfsCO7pKsqI1ddBkN7OsckbG5DhjY0a19E9CX9hNcsyJ7Y8FEtzwmAR8DpuboO3gc+E4kekmYCnwUmBzn/QWeA+4H+jJmv2nA3wLjY/ztAeDLwOaT/PsE4G+AGTZVvGq8PAr8KEs3vXPJvPO8gvsg4sZWyy5+KXh0ymfWVN0uKxdT7Bi34CMicvZIfP+CBgEEogwq9Ktor1OOoBxUdH8QyO5BBvY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dgbiUixTu9vG/Bt4F6gHhorVyORKiAsr7m1Cvc7lJz11iqMTfN0DaP+PNsDIM9roN8P/NKPthxdtyoPyVJ5Ed2jwBcJj6j8GWGpxzidZtIWWgiL/f8UeAB4jHh9bKvBUPKQpmin3kgYq7FHfXzzhEkpX9s8XcMYSYH945yph1DZAPqEHwQ/LQSlJ9vb1m+T5dmsMJVn0SXyHlcDD0Xe0JXABcDU6FlqJcAaeXw7IgF6OBLdequS4pP+MZnNhBWkqhX6eTb6nv9Lyt+nebqGUSOBFQhVVrWEyEFF94jSrYE+g+jvAvVfONjP1q57ukfdQjiLe7p+JLxD4nsmYXP5N0be7xmEtZTTrqGs0WcfAF6MPLLHCPc299exrQ6R3r7yUB/gajZr2EcYvr6EdBtOHIa6DluVUri/QRgd3kIVv4PSy05ZLH+udvZXSorWdEwLqiCqoIKWFEoSRr0GQHpV9ZjAXkV7VHUzyEZhcINqsLEw4O8ev33T4Sx2BkrXhvnAAeMI2/udG/2cBcwmDFO28cpmBnKC59dhXqxGk9h+wq5E3cDTwO8jT2xnnU/iRM98ebQQSUt0V1GdJKrj6YxEN83xuSOKRtSjKDUCV1LcGm0AAAETSURBVAATEl4niL6bF00/K2PlYoqzx3ddEYjXHnel5wNO+UP7bS9WPZ9DQfZ+esEVTmRKTQ0ViPrqqxPnq+igE/r9UtArQXBsUPVw0ZeDhZaBo+MG+wc4vHNAcr4/O5pFdzgNhB1rpkQ/06KfKZEIj+flzkIumqwGCEOxBwgL+W8/7qeHMImrD0b3Ks0wDMMw0S3X65Nh3q47TnSDYV5ugIXqDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwDMMwjPzz/wEu4k8eiN1t8wAAAABJRU5ErkJggg==";
  private static final Base64.Decoder DECODER = Base64.getDecoder();
  private static final long serialVersionUID = 1L;
  private final JPanel pan;

  public JLabelLink(String title, int x, int y) {
    this.setTitle(title);
    this.setSize(x, y);
    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    this.setBounds(0, 0, x, y);
    this.setLocationRelativeTo(null);
    this.setLocationRelativeTo(null);

    pan = new JPanel();
    pan.setBorder(new EmptyBorder(10, 10, 10, 10));
    BoxLayout boxLayout = new BoxLayout(pan, BoxLayout.Y_AXIS);
    pan.setLayout(boxLayout);

    this.setContentPane(pan);
    this.setVisible(true);
  }

  public void addURL(String content, String tooltip) {
    JLabel label = new JLabel("<html>" + content + "</html>");
    label.putClientProperty("html.disable", null);
    label.setCursor(new Cursor(Cursor.HAND_CURSOR));
    label.setToolTipText(tooltip);
    addMouseHandler(label);
    pan.add(label);
  }

  public void addText(String content) {
    JLabel label = new JLabel("<html>" + content + "</html>");
    label.putClientProperty("html.disable", null);
    pan.add(label);
  }

  public void addLogoImage() {
    byte[] imageBytes = DECODER.decode(LOGO_DATA);
    try {
      BufferedImage img = ImageIO.read(new ByteArrayInputStream(imageBytes));
      ImageIcon icon = new ImageIcon(img);
      JLabel label = new JLabel();
      label.setIcon(icon);
      pan.add(label);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  private void addMouseHandler(final JLabel website) {
    website.addMouseListener(new MouseAdapter() {

      @Override
      public void mouseClicked(MouseEvent e) {
        try {
          String href = parseHREF(website.getText());
          Desktop.getDesktop().browse(new URI(Objects.requireNonNull(href)));
        } catch (Exception ex) {
          Output.outputError("Exception trying to browser from jlabel href - "+ex.getMessage());
        }
      }
    });
  }

  private static String parseHREF(String html) {
    String hrefMarker = "href=\"";
    int hrefLoc = html.indexOf(hrefMarker);
    if (hrefLoc > 1) {
      int hrefEndLoc = html.indexOf("\">");
      if (hrefEndLoc > hrefLoc + 4) {
        return html.substring(hrefLoc + hrefMarker.length(), hrefEndLoc);
      }
    }
    return null;
  }

}
